
product_data = {
    'brand': 'This is a very long brand name that exceeds thirty characters'
}

# 检查品牌名称的长度
if len(product_data['brand']) > 30:
    # 将品牌名称按空格分割成单词列表
    words = product_data['brand'].split()
    # 取前两个单词
    shortened_brand = ' '.join(words[:2])
else:
    # 如果长度不超过30，保持原样
    shortened_brand = product_data['brand']

print(f"Shortened Brand: {shortened_brand}")